package com.community.process._1010.dao.view;

import com.community.process._1010.dao.entity.ProcessCategory;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * @Description:
 * @Author: Administrator to Zbs
 * @Date: 2024/9/6 星期五 13:24
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "分类展示DTO")
public class ProcessCategoryView implements Serializable {

    private static final long serialVersionUID = 7022953566101647359L;

    @Schema(description = "ID")
    private Long id;

    @Schema(description = "名称")
    private String name;

    @Schema(description = "菜单级别")
    private Integer level;

    @Schema(description = "上级菜单ID")
    private Long parentId;

    @Schema(description = "编码")
    private String treeCode;

    @Schema(description = "图标")
    private String icon;

    @Schema(description = "排序")
    private Integer sort;

    public ProcessCategoryView(ProcessCategory category) {
        this.id = category.getId();
        this.name = category.getName();
        this.level = category.getLevel();
        this.parentId = category.getParentId();
        this.treeCode = category.getTreeCode();
        this.icon = category.getIcon();
        this.sort = category.getSort();
    }
}
